package com.yscp.ysdemo.constant;

/**
 * 用于抛业务异常的枚举
 */
public enum ResultEnum {

    UNKNOWN_ERROR(-100, "未知错误"),
    REPEAT_REGISTER(-2, "该用户已存在"),
    USER_NOT_EXIST(-3, "不存在该用户"),
    LOGIN_ERROR(-4, "用户名或密码错误"),
    AUTHORITY_ERROR(-5,"您没有对应的权限!"),
    SUCCESS(1, "操作成功！"),
    NEED_LOGIN(-6, "请先登录"),
    SENSITIVE_WORDS(-7,"包含敏感词汇，请重新输入"),
    SYSTEM_ERROR(-200,"服务器出了点小差错~"),
    PARAM_ERROR(-8,"参数不能为空");
    private Integer code;

    private String msg;

    //该构造器是给编译器调用的
    private ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {

        return code;
    }

    public String getMsg() {
        return msg;
    }
}
